<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>帘子效果</title>
		<style type="text/css">
			#div{
				width: 300px;
				height: 250px;
			}
			.forest{
				width: 300px;
				height: 0px;
				background-color: red;
				position: absolute;
				/* 绝对定位 */
				opacity: 0.5;
			}
			#div img{
				width: 300px;
				height: 250px;
			}
			#div:hover .forest{
				height: 250px;
				transition: 0.1s;
				/* 过度时间为3秒 */
			}
		</style>
	</head>
	<body>
		
		<div id="div">
			<div class="forest"></div>
			<img src="img/timg.jpg" >
		</div>
		
	</body>
</html>
